package ms.aurora.mvp;

import ms.aurora.app.AppWindow;

import javax.swing.*;

/**
 * @param <V>
 * @author rvbiljouw
 */
public abstract class AbstractPresenter<V extends IView> {
    private final AppWindow appWindow;
    private final V view;

    public AbstractPresenter(AppWindow appWindow, V view) {
        this.appWindow = appWindow;
        this.view = view;
    }

    public V getView() {
        return view;
    }

    public void popDialog() {
        JDialog dialog = new JDialog();
        dialog.add(view.asComponent());
        dialog.pack();
        dialog.setVisible(true);
    }

    public AppWindow getAppWindow() {
        return appWindow;
    }

    public abstract void show();

}
